﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace BuildHelper.Admin
{
    public partial class FormAdminInfoMsg : XtraForm
    {
        public FormAdminInfoMsg()
        {
            InitializeComponent();
        }
        
        public Func<string, bool> ValidationFunc
        {
            get;
            set;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            if (ValidationFunc != null)
            {
                if (ValidationFunc.Invoke(Message))
                {
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                }
            }
        }

        public string Message
        {
            get { return meMsg.Text; }
            set { meMsg.Text = value; }
        }
    }
}
